package com.nanrui.mutualinductor;

import android.bluetooth.BluetoothDevice;
import android.os.Parcel;
import android.os.Parcelable;

public class BluetoothInfo
        implements Parcelable {

    public static final Parcelable.Creator<BluetoothInfo> CREATOR = new Parcelable.Creator() {
        @Override
        public BluetoothInfo createFromParcel(Parcel paramAnonymousParcel) {
            return new BluetoothInfo(paramAnonymousParcel);
        }

        @Override
        public BluetoothInfo[] newArray(int paramAnonymousInt) {
            return new BluetoothInfo[paramAnonymousInt];
        }
    };
    public static final byte STATUS_CONNECTED = 2;
    public static final byte STATUS_CONNECTING = 1;
    public static final byte STATUS_CONNECT_ERROR = 3;
    public static final byte STATUS_DISCONNECTING = 4;
    public static final byte STATUS_NOT_CONNECT = 0;
    private BluetoothDevice bluetoothDevice;
    private byte connectStatus = (byte) 0;
    private BluetoothDevice nextBluetoothDevice;

    public BluetoothInfo() {
    }

    protected BluetoothInfo(Parcel paramParcel) {
        this.bluetoothDevice = ((BluetoothDevice) paramParcel.readParcelable(BluetoothDevice.class.getClassLoader()));
        this.connectStatus = paramParcel.readByte();
    }

    public boolean compareDevice(BluetoothDevice paramBluetoothDevice) {
        boolean bool;
        if (this.bluetoothDevice == null) {
            if (paramBluetoothDevice == null) {
                bool = true;
            } else {
                bool = false;
            }
        } else {
            bool = this.bluetoothDevice.equals(paramBluetoothDevice);
        }
        return bool;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public BluetoothDevice getBluetoothDevice() {
        return this.bluetoothDevice;
    }

    public byte getConnectStatus() {
        return this.connectStatus;
    }

    public BluetoothDevice getNextBluetoothDevice() {
        return this.nextBluetoothDevice;
    }

    public BluetoothInfo setBluetoothDevice(BluetoothDevice paramBluetoothDevice) {
        this.bluetoothDevice = paramBluetoothDevice;
        return this;
    }

    public BluetoothInfo setConnectStatus(byte paramByte) {
        this.connectStatus = ((byte) paramByte);
        return this;
    }

    public BluetoothInfo setNextBluetoothDevice(BluetoothDevice paramBluetoothDevice) {
        this.nextBluetoothDevice = paramBluetoothDevice;
        return this;
    }

    @Override
    public void writeToParcel(Parcel paramParcel, int paramInt) {
        paramParcel.writeParcelable(this.bluetoothDevice, paramInt);
        paramParcel.writeByte(this.connectStatus);
    }
}

